//
//  ZFCustomControlView.m
//  ZFPlayer_Example
//
//  Created by 紫枫 on 2019/6/5.
//  Copyright © 2019 紫枫. All rights reserved.
//

#import "AudioCoverView.h"

@interface AudioCoverView ()

@end

@implementation AudioCoverView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithRed: 24/255.0 green: 142/255.0 blue: 246/255.0 alpha: 1]; //RGB(r: 24, g: 144, b: 255);
//        self.backgroundColor =  [UIColor colorWithRed: 84 green: 142 blue: 246 alpha: 1];
        [self addAllSubViews];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self resetControlView];
}

- (void)dealloc {

}

- (void)resetControlView {
    CGFloat img_w = 120;
    CGFloat img_H = 55;
    CGFloat min_view_w = self.bounds.size.width;
    CGFloat min_view_h = self.bounds.size.height;

    self.audioLogo.frame = CGRectMake((min_view_w - img_w)/2, (min_view_h - img_H)/2, img_w, img_H);
}

/// 添加所有子控件
- (void)addAllSubViews {
    [self addSubview:self.audioLogo];

}

/// 添加所有子控件
- (UIImageView *)audioLogo {
    if(!_audioLogo){
        _audioLogo = [[UIImageView alloc] initWithFrame:CGRectZero];
        _audioLogo.image = UXUtilities_Image(@"audio");
    }
    return  _audioLogo;
}

@end
